<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>搜索</button>
    <input type="text" value="输入内容">
    <script>
        //获得元素
        var input = document.querySelector('input');
        var btn = document.querySelector('button');
        //注册事件
        btn.onclick = function(){
            input.value = '被单击了！';//通过value属性来修改表单里面的值
            this.disabled = true; //将被单击的按钮禁用
        };
    </script>
</body>
</html>